﻿Imports System
Imports System.Collections.Generic
Imports System.Collections.ObjectModel
Imports System.Workflow.ComponentModel

Namespace System.Workflow.ComponentModel.Design
    <ActivityDesignerTheme(GetType(CancellationDesignerTheme))> _
    Friend NotInheritable Class CancellationHandlerActivityDesigner
        Inherits SequentialActivityDesigner
        ' Methods
        Public Overrides Function CanInsertActivities(ByVal insertLocation As HitTestInfo, ByVal activitiesToInsert As ReadOnlyCollection([Of] Activity)) As Boolean
            Dim activity As Activity
            For Each activity In activitiesToInsert
                If Helpers.IsFrameworkActivity(activity) Then
                    Return False
                End If
            Next
            Return MyBase.CanInsertActivities(insertLocation, activitiesToInsert)
        End Function


        ' Properties
        Public Overrides ReadOnly Property CanExpandCollapse As Boolean
            Get
                Return False
            End Get
        End Property

        Public Overrides ReadOnly Property Views As ReadOnlyCollection([Of] DesignerView)
            Get
                Dim list As New List([Of] DesignerView)
                Dim view As DesignerView
                For Each view In MyBase.Views
                    If (((view.ViewId <> 2) AndAlso (view.ViewId <> 3)) AndAlso (view.ViewId <> 4)) Then
                        list.Add(view)
                    End If
                Next
                Return New ReadOnlyCollection([Of] DesignerView)(list)
            End Get
        End Property

    End Class
End Namespace

